package com.dq.repository.user;

import com.dq.domain.org.Org;
import com.dq.domain.sys.section.SysSection;
import com.dq.domain.sys.user.user.BossUser;
import com.dq.domain.sys.user.user.base.SysUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author liuhui
 * @date 2019/12/3 0003 10:40:22
 */
@Repository
public interface BossUserRepository extends JpaRepository<BossUser,Long> {
    BossUser findByDeletedFalseAndUsernameAndStatus(String username, SysUser.Status status);
    BossUser findByDeletedFalseAndMobileAndStatus(String mobile, SysUser.Status status);
    List<BossUser> findByOrgPositionPostNameAndStatusAndDeletedFalse(String postName,SysUser.Status status);


    BossUser findByUsernameAndStatus(String username, SysUser.Status status);
    BossUser findByUsername(String username);

    List<BossUser> findByDeletedFalseAndSection(SysSection section);

    List<BossUser> findByDeletedFalse();

    List<BossUser> findByDeletedFalseAndSectionOrderByAverageScoreDesc(SysSection sysSection);

}
